{% extends "auth/base.html" %}

{% load url from future %}
{% block title %}Inicio de sesión{% endblock %}
{% block content %}
    {% if form.errors %}
        <p>El nombre de usuario y la contraseña no coinciden. Intente otra vez.</p>
    {% endif %}
    <form method="post" action="{% url 'django.contrib.auth.views.login' %}">
        {% csrf_token %}
        <table>
            <tr>
                <td>{{ form.username.label_tag }}</td>
                <td>{{ form.username }}</td>
            </tr>
            <tr>
                <td>{{ form.password.label_tag }}</td>
                <td>{{ form.password }}</td>
            </tr>
        </table>
        <input type="submit" value="Acceder" />
        {% if next %}
            <input type="hidden" name="next" value="{{ next }}" />
        {% else %}
            <input type="hidden" name="next" value="/login_exitoso" />
        {% endif %}
    </form>
{% endblock %}
